<template>
  <div class="card_back">
    <div class="card_map"></div>
    <div class="card_head" @click="handleClick">
      <p class="card_head2">{{card.brief}}</p>
      <p class="card_head2">{{ card.postcode }}</p>
      <div class="card_water">
        <i
          class="iconfont icon-shuibei"
          v-for="i in 5"
          :class="{ card_water_gray: i > card.level }"
          :key="`${i}`"
        />
      </div>
    </div>
    <div class="card_body">
      <abstract :posts="card.posts" :card="card" :is-follow="isFollow"/>
      <div class="card_content" @click="handleClick">{{card.content}}</div>
    </div>
  </div>
</template>

<script>
import Abstract from './Abstract.vue'
export default {
  components: {
    Abstract
  },
  props: {
    card: {
      type: Object
    },
    isFollow:{
      type: Boolean
    }
  },
  methods:{
    handleClick(){
      this.$emit("handleClick")
    }
  }
}
</script>

<style lang="less">
.card_back {
  position: relative;
  padding-top: 250px;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
  color: #999;
  background-color: white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  font-size: 12px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease;

  .card_content {
    transform-origin: top;
    padding: 16px 30px;
    border-bottom: 1px solid #f9f9f9;
    transform: scale3d(1, 0, 1);
    opacity: 0;
  }
}
.card_map {
  height: 100px;
  //background-image: url(../../assets/card-wall.png);
  background-size: cover;
  opacity: 0;
  transform: translate3d(0, 0, 0);
}
.card_head2 {
  padding: 6px 24px 0;
  line-height: 16px;
  transform: translate3d(0, 22px, 0);
}
.card_water {
  padding: 6px 24px;
  color: deepskyblue;
  transform: translate3d(62%, 0, 0);
  .iconfont.icon-shuibei {
    font-size: 10px;
    margin: 0 1px;
    line-height: 16px;
  }
}
.card_water_gray {
  color: #eee;
}
.card_head {
  padding-bottom: 8px;
  border-bottom: 1px solid #f9f9f9;
}

</style>
